package com.tjetc.controller;

import com.tjetc.common.JsonResult;
import com.tjetc.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("home")
public class HomeController {

@Autowired
    HomeService homeService;
   // 作用于这个接口

    @RequestMapping("show")

    public JsonResult getShow() {return homeService.getHomeShow();}
    @RequestMapping("destinations/{length}")
    public JsonResult getDestinations(@PathVariable("length")Integer l) {return homeService.getDestinations(l);}
    @RequestMapping("getguides/{length}")
    public JsonResult getGuides(@PathVariable("length")Integer l) {return homeService.getGuides(l);}
    @RequestMapping("travelogues/{length}")
    public JsonResult getTravelogues(@PathVariable("length")Integer l) {return homeService.getTravelogues(l);}
    @RequestMapping("search/{s}")
    public JsonResult search(@PathVariable("s")String s) {return homeService.search(s);}


}
